/**
 * <copyright>
 * </copyright>
 *

 */
package org.eclipse.gittab.gitTabDsl.impl;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.gittab.gitTabDsl.GitTabDslPackage;
import org.eclipse.gittab.gitTabDsl.NoteName;
import org.eclipse.gittab.gitTabDsl.Notes;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Note Name</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.eclipse.gittab.gitTabDsl.impl.NoteNameImpl#getNote <em>Note</em>}</li>
 *   <li>{@link org.eclipse.gittab.gitTabDsl.impl.NoteNameImpl#isOctave <em>Octave</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class NoteNameImpl extends NoteWrapperImpl implements NoteName
{
  /**
   * The default value of the '{@link #getNote() <em>Note</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getNote()
   * @generated
   * @ordered
   */
  protected static final Notes NOTE_EDEFAULT = Notes.C;

  /**
   * The cached value of the '{@link #getNote() <em>Note</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getNote()
   * @generated
   * @ordered
   */
  protected Notes note = NOTE_EDEFAULT;

  /**
   * The default value of the '{@link #isOctave() <em>Octave</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isOctave()
   * @generated
   * @ordered
   */
  protected static final boolean OCTAVE_EDEFAULT = false;

  /**
   * The cached value of the '{@link #isOctave() <em>Octave</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isOctave()
   * @generated
   * @ordered
   */
  protected boolean octave = OCTAVE_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected NoteNameImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return GitTabDslPackage.Literals.NOTE_NAME;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Notes getNote()
  {
    return note;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setNote(Notes newNote)
  {
    Notes oldNote = note;
    note = newNote == null ? NOTE_EDEFAULT : newNote;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GitTabDslPackage.NOTE_NAME__NOTE, oldNote, note));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public boolean isOctave()
  {
    return octave;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setOctave(boolean newOctave)
  {
    boolean oldOctave = octave;
    octave = newOctave;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GitTabDslPackage.NOTE_NAME__OCTAVE, oldOctave, octave));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case GitTabDslPackage.NOTE_NAME__NOTE:
        return getNote();
      case GitTabDslPackage.NOTE_NAME__OCTAVE:
        return isOctave();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case GitTabDslPackage.NOTE_NAME__NOTE:
        setNote((Notes)newValue);
        return;
      case GitTabDslPackage.NOTE_NAME__OCTAVE:
        setOctave((Boolean)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case GitTabDslPackage.NOTE_NAME__NOTE:
        setNote(NOTE_EDEFAULT);
        return;
      case GitTabDslPackage.NOTE_NAME__OCTAVE:
        setOctave(OCTAVE_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case GitTabDslPackage.NOTE_NAME__NOTE:
        return note != NOTE_EDEFAULT;
      case GitTabDslPackage.NOTE_NAME__OCTAVE:
        return octave != OCTAVE_EDEFAULT;
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (note: ");
    result.append(note);
    result.append(", octave: ");
    result.append(octave);
    result.append(')');
    return result.toString();
  }

} //NoteNameImpl
